#pragma once
#include "ientity.h"
class CEntity :
	public IEntity
{
public:
	CEntity( void );
	virtual ~CEntity( void );

	// IEntity Interface:
	virtual void Update( float fElapsedTime );
	virtual void Render( void );
	
	virtual void AddRef( void );
	virtual void Release( void );

	virtual int GetType( void );
	virtual RECT GetRect( void );

	virtual bool CheckCollision( IEntity * pOther );

	int		GetImageID	( void ) const	{	return m_nImageID;	}
	float	GetPosX		( void ) const	{	return m_nPosX;		}
	float	GetPosY		( void ) const	{	return m_nPosY;		}
	float	GetVelX		( void ) const	{	return m_nVelX;		}
	float	GetVelY		( void ) const	{	return m_nVelY;		}
	int		GetWidth	( void ) const	{	return m_nWidth;	}
	int		GetHeight	( void ) const	{	return m_nHeight;	}
		
	// Mutators:
	void	SetImageID	( int id	 )	{	m_nImageID	= id;	}
	void	SetPosX		( float x	 )	{	m_nPosX		= x;	}
	void	SetPosY		( float y	 )	{	m_nPosY		= y;	}
	void	SetVelX		( float vx	 )	{	m_nVelX		= vx;	}
	void	SetVelY		( float vy	 )	{	m_nVelY		= vy;	}
	void	SetWidth	( int w		 )	{	m_nWidth = w;		}
	void	SetHeight	( int h		 )	{	m_nHeight = h;		}

	short	GetHealth		( void )	{	return m_sHealth		; }
	float	GetAttackSpeed	(void)		{	return m_fAttackSpeed	; }
	float	GetAttackDamage	(void)		{	return m_fAttackDamage	; }
	float	GetMoveSpeed	(void)		{	return m_fMoveSpeed		; }
	short	GetDefense		(void)		{	return m_sDefense		; }
	float	GetRange		(void)		{	return m_fRange			; }

	void	SetHealth		(short h)		{ m_sHealth			= h; }
	void	SetAttackSpeed	(float as)		{ m_fAttackSpeed	= as; }
	void	SetAttackDamage	(float ad)		{ m_fAttackDamage	= ad; }
	void	SetMoveSpeed	(float ms)		{ m_fMoveSpeed		= ms; }
	void	SetDefense		(short d)		{ m_sDefense		= d; }
	void	SetRange		(float r)		{ m_fRange			= r; }

	void SetTeam(int team)		{m_nTeam = team;}
	int  GetTeam(void)			{return m_nTeam;}

	enum ObjType {	Obj_Base, Obj_Elemental, Obj_Avatar, Obj_Tower, Obj_Waypoint, Obj_TargetBox };


protected:
	int TypeofObj;

	private:
	// image
	int				m_nImageID;
	int				m_nActionID;

	int m_nTeam;


	// position
	float				m_nPosX;
	float				m_nPosY;

	// velocity
	float				m_nVelX;
	float				m_nVelY;

	// todo: add size

	// reference count
	unsigned int	m_unRefCount;

	int				m_nWidth;
	int				m_nHeight;

	short	m_sHealth;
	float	m_fAttackSpeed;
	float	m_fAttackDamage;
	float	m_fMoveSpeed;
	short	m_sDefense;
	float	m_fRange;
};

